package ua.kiev.tosik.price.modules.search;

import org.apache.log4j.Logger;
import ua.kiev.tosik.price.IChapter;
import ua.kiev.tosik.price.modules.search.conf.ModuleConfig;
import ua.kiev.tosik.price.modules.search.gui.MainPanel;

import javax.swing.*;

public class PriceSearchModule implements IChapter {

	private static Logger logger = Logger.getLogger("ua.kiev.tosik.price.modules.search");
	private MainPanel panel;
	private String tabKey;

	@Override
	public String getTitle() {
		return ModuleConfig.getInstance().get("search.chapter.title");
	}

	@Override
	public JComponent getPanel() {
		return panel.getPanel();
	}

	@Override
	public ImageIcon getImageIcon() {
		return null;
	}

	@Override
	public void init() {
		logger.debug("Initialize [" + getTitle() + "] module");
		panel = new MainPanel();
		panel.setModule(this);
	}

	@Override
	public void destroy() {
		logger.debug("Destroy resources for [" + getTitle() + "]");
	}

	@Override
	public String getTabKey() {
		return tabKey;
	}

	@Override
	public void setTabKey(String tabKey) {
		this.tabKey = tabKey;
	}
}
